'use strict';
/**
 * Palette Restore Scope
 * Heuristic: find sections that contain palette tools by text cues and mark them
 * so CSS can avoid neutralizing colors.
 */
(function(){
  function markScope() {
    var cues = [/按颜色/, /色盘/, /颜色情绪/, /ΔE/, /取色/, /吸管取色/];
    var nodes = Array.from(document.querySelectorAll('section, .section, main, article, .panel, .box, .module, .card, div'));
    nodes.forEach(function(n){
      var txt = (n.textContent || '').slice(0, 1000);
      if (cues.some(function(rx){ return rx.test(txt); })) {
        var host = n.closest('section, .section, article, main') || n;
        host.setAttribute('data-palette-scope','');
      }
    });
  }
  document.addEventListener('DOMContentLoaded', markScope);
})();
